<%--
  Created by IntelliJ IDEA.
  User: konley
  Date: 2020/6/10
  Time: 13:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="pojo.Student" %>
<%@ page import="pojo.Card" %>
<html>
<head>
    <title>学生页 | 校园一卡通</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/css.css"/>
    <script src="${pageContext.request.contextPath }/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath }/js/jquery-3.4.1.js" type="text/javascript"
            charset="utf-8"></script>
    <style type="text/css">
        body {
            background-image: url("photo/bg.jpg");
        }
    </style>
</head>
<body>
<!--top-->
<div style="background-color:#444;">
    <div class="container">
        <div class="row">
            <h2 style="color: white;font-weight: bold;">校园一卡通系统 | <span style="color: #FF6666;">学生端</span></h2>
        </div>
    </div>
</div>
<div class="container">
    <br>
    <%
        Student stu = (Student) session.getAttribute("student");
        Card card = (Card) session.getAttribute("card");
    %>
    <!--欢迎-->
    <div class="row">
        <div class="alert alert-success">欢迎您，<%=stu.getName()%>同学，学号<%=stu.getSid()%>
        </div>
    </div>

    <div class="row">
        <div class="panel-primary panel">
            <div class="panel-body">
                <div class="col-sm-6">
                    <table class="table table-bordered">
                        <tbody>
                        <tr>
                            <td>学号：</td>
                            <td><%=stu.getSid()%>
                            </td>
                        </tr>
                        <tr>
                            <td>姓名：</td>
                            <td><%=stu.getName()%>
                            </td>
                        </tr>
                        <tr>
                            <td>密码：</td>
                            <td><%=stu.getPassword()%>
                            </td>
                        </tr>
                        <tr>
                            <td>性别：</td>
                            <td><%=stu.getSex()%>
                            </td>
                        </tr>
                        <tr>
                            <td>系别：</td>
                            <td><%=stu.getDept()%>
                            </td>
                        </tr>
                        <tr>
                            <td>联系电话：</td>
                            <td><%=stu.getTel()%>
                            </td>
                        </tr>
                        </tbody>
                        <%
                            if (request.getAttribute("msg") != null) {
                        %>
                        <div class="alert alert-success" style="text-align: center">提示：<%=request.getAttribute("msg")%>
                        </div>
                        <% } %>
                    </table>
                </div>

                <div class="col-sm-6">
                    <h4>卡号：<kbd><%=card.getCid()%>
                    </kbd></h4>
                    <br>
                    <h4>当前余额：<span style="color: #c7254e"><%=card.getMoney()%>.00元</span></h4>
                    <h4>最大可存余额：<span style="color:dodgerblue">1000.00元</span></h4>
                    <br>
                    <div class="progress progress-striped active">
                        <div class="progress-bar progress-bar-success" role="progressbar"
                             style="width: <%=card.getMoney()/10%>%;">
                        </div>
                    </div>
                    <div  style="text-align: right;margin-top: 8%" >
                        <a href="StudentServlet?m=doUpdate&id=<%=stu.getSid()%>">
                            <button type="button" class="btn btn-info btn-sm">修改信息</button>
                        </a>
                        <a href="BillServlet?m=select&cid=<%=card.getCid()%>">
                            <button type="button" class="btn btn-success btn-sm">查看消费记录</button>
                        </a>
                        <a href="QuitServlet">
                            <button type="button" class="btn btn-danger btn-sm">退出登录</button>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
</body>
</html>
